<template>
	<view style="background-size: 450rpx;background-repeat: no-repeat;background-position-y: bottom;background-position-x: 130%;">
	<view style="height: auto;">
		<div class="test-component">
		  <hm-friends-list :options="list"></hm-friends-list>
		</div>
	</view>
	<view class="dialogue">
		<view class="right">
			小度小度，打开窗帘
		</view>
		<view class="right">
			小度小度，关闭窗帘
		</view>
		<view class="right">
			小度小度，打开窗纱
		</view>
		<view class="right">
			小度小度，关闭窗纱
		</view>
	</view>
	</view>
</template>

<script>
import HmFriendsList from '@/components/Curtain-list/index.vue'
import {_openWindowScreen,_closeWindowScreen} from '@/common/vmeitime-http/controller.js'
import Vue from 'vue'
export default {
  components: { HmFriendsList },
  data() {
    return {
			curtainflag:0,  //窗帘标志位
			wireNettflag:0, //窗纱标志位
			list:{
					friendsList: '窗帘控制',
					static:1,
					list:[]
				}
					
    };
  },
  onShow(){
  		console.log(uni.getStorageSync('equipmentlist').CURTAIN)
  		this.list.list = uni.getStorageSync('equipmentlist').CURTAIN
   },
  methods:{
    btnclick(count,item) {
		var obj = {
			  "duerosType": "CURTAIN",
			  "equipId": this.list.list[count].equipId,
			  "hotelId": uni.getStorageSync('controller').hotleId,
			  "position": this.list.list[count].position,
			  "positionBak": this.list.list[count].positionBak,
			  "realName":uni.getStorageSync('controller').realName,
			  "roomId": uni.getStorageSync('controller').id,
			  "roomNumber": uni.getStorageSync('controller').name,
			}
		console.log(item)
		if(item == 1 || item == 3){
			this.curtainflag = item;
		}
		if(item == 2 && this.curtainflag != 0){
			item = this.curtainflag;
		}
		switch(item){
			case 1:
				_openWindowScreen(obj).then(res => {
					console.log(res)
				}).catch( error =>{
				console.log(error)
			})
			break;
			case 3:
				_closeWindowScreen(obj).then(res => {
					console.log(res)
				}).catch( error =>{
				console.log(error)
			})
			break;
		}
		// 	 if(this.list.list[item].active==1){
		// 		 this.list.list[item].active=0
		// 	//	Vue.set(item,'active', '0')
				
		// 	}else{
		// 		this.list.list[item].active=1
		// //	Vue.set(item,'active','1')
		// 	// 	item.active = 1
		// 	}
		// 	//console.log(item)
	
    }
  }
};
</script>


<style>
	page{
		height: 100%;
		background-color: #F8F8F8;
		/* background-color: rgba(1,1,1,0.5); */
		/* background: linear-gradient(to top, #22223c, #3f3f63); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+  */
	}
	.dialogue{
		margin-top: 60rpx;
		padding-left: 20rpx;
		font-size: 30rpx;
		color: #ffffff;
		display: flex;
		flex-direction: column;
		


	}
	.dialogue .right{
		height: 80rpx;
		padding: 0 25rpx 0 25rpx;
		border-radius: 25rpx;
		border-top-left-radius: 0rpx;
		/* background-color: rgb(121,125,210,0.4);*/
		 background-color: #FFBC15;
		display: flex;
		align-items: center;
		margin-bottom: 22px;
		width: fit-content;
		box-shadow: 0px 1px 10px rgba(111, 113, 118, 0.5);
	}
</style>